﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XCI.Core;

namespace XCI.Windows.Plugin.GridSetting
{
    /// <summary>
    /// 表格配置接口
    /// </summary>
    public interface IGridSetting
    {
        /// <summary>
        /// 加载配置
        /// </summary>
        /// <param name="gridId">表格Id</param>
        string LoadSetting(string gridId);

        /// <summary>
        /// 加载默认配置
        /// </summary>
        /// <param name="gridId">表格Id</param>
        string LoadDefaultSetting(string gridId);

        /// <summary>
        /// 保存配置
        /// </summary>
        /// <param name="gridId">表格Id</param>
        /// <param name="data">配置数据</param>
        BoolMessage SaveDefaultSetting(string gridId, string data);

        /// <summary>
        /// 保存配置
        /// </summary>
        /// <param name="gridId">表格Id</param>
        /// <param name="data">配置数据</param>
        BoolMessage SaveSetting(string gridId, string data);

        /// <summary>
        /// 删除表格配置
        /// </summary>
        /// <param name="gridId">表格Id</param>
        BoolMessage DeleteSetting(string gridId);

        #region 模板

        /// <summary>
        /// 加载表格配置模板
        /// </summary>
        /// <param name="gridId">表格Id</param>
        /// <param name="name">模板名称</param>
        string LoadTemplateSetting(string gridId, string name);

        /// <summary>
        /// 保存表格配置模板
        /// </summary>
        /// <param name="gridId">表格Id</param>
        /// <param name="name">模板名称</param>
        /// <param name="data">配置数据</param>
        BoolMessage SaveTemplateSetting(string gridId, string name, string data);

        /// <summary>
        /// 获取表格配置模板名称列表
        /// </summary>
        /// <param name="gridId">表格Id</param>
        string[] GetTemplates(string gridId);

        /// <summary>
        /// 删除表格配置模板
        /// </summary>
        /// <param name="gridId">表格Id</param>
        /// <param name="name">模板名称</param>
        BoolMessage DeleteTemplateSetting(string gridId, string name);

        /// <summary>
        /// 复制表格配置模板
        /// </summary>
        /// <param name="gridId">表格Id</param>
        /// <param name="name">当前模板名称</param>
        /// <param name="newName">新模板名称</param>
        BoolMessage CopyTemplate(string gridId, string name, string newName);

        #endregion
    }
}
